﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Clueless
{
    public partial class suggestionDisproved : Form
    {
        protected delegate void DisprovalDelegate(String suspect, String weapon, String room, String disprover, String suggester, String card, bool isSuggester, String me);


        public suggestionDisproved()
        {
            InitializeComponent();
        }


        public void SetDisproval(String suspect, String weapon, String room, String disprover, String suggester, String card, bool isSuggester, String me)
        {
            if (suspectTextBox.InvokeRequired)
                suspectTextBox.Invoke(new DisprovalDelegate(SetDisproval), suspect, weapon, room, disprover, suggester, card, isSuggester, me);
            else
            {
                cardLabel.Visible = isSuggester;
                cardTextBox.Visible = isSuggester;

                suspectTextBox.Text = suspect;
                weaponTextBox.Text = weapon;
                currentRoomTextBox.Text = room;

                disprovedByTextBox.Text = disprover;
                cardTextBox.Text = card;

                if (isSuggester)
                {
                    this.Text = (card == "none") ? "Your suggestion was not disproved!" : "Your suggestion was disproved!";
                }
                else
                {
                    this.Text = me + ": ";
                    this.Text += (card == "none") ? suggester + "'s suggestion was not disproved!" : suggester + "'s suggestion was disproved!";
                }

            }
        }


        private void suspectLabel_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void closeButton_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
